#ifndef CADDFIELDDIALOG_H
#define CADDFIELDDIALOG_H

#include <QtGui/QDialog>

#include "src/centry.h"

namespace Ui {
    class CAddFieldDialog;
}

class CAddFieldDialog : public QDialog {
    Q_OBJECT
public:
    CAddFieldDialog(CEntry*, QWidget *parent = 0);
    ~CAddFieldDialog();

    int type();
    QString entry_id();
    QVariant name();
    QVariant value();
    int order();

    QMap<QString, QVariant> map();
    QStringList blobs();

    void setField(CEntryField*);

protected:
    void changeEvent(QEvent *e);

private:
    Ui::CAddFieldDialog *m_ui;
    CEntry *m_entry;

    enum
    {
        Text,
        Password,
        Url,
        Image,
        Binary
    };

private slots:
    void checkFields();
    void openImage();
    void openFile();
    void process();

signals:
    void field(CAddFieldDialog*);
};

#endif // CADDFIELDDIALOG_H
